#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main()
{
    int a, b;
    int c = 0;

    while (scanf("%d %d", &a, &b) == 2)
    {
        c = a ^ b;
        int count = 0;
        while (c)
        {
            c = c & (c - 1);
            count++;
        }
        printf("%d", count);
    }
    return 0;
}